<?php

//include_once('load.php'); // can be replaced when config.php is done
include_once('config.php');
include_once('libs.php');
include_once('lwa.php');
$pun_user = array();
check_cookie($pun_user);

if($pun_user["is_guest"]) {
// Create login form for user to login here.
?>
Please login to access Warmath.
<?php
   exit;
}

$forum_id = $pun_user["id"];

$sql = "SELECT * FROM wm_systems LEFT JOIN wm_characters ON wm_characters.character_system_id = wm_systems.system_id WHERE wm_characters.character_forum_id = '$forum_id' AND wm_characters.character_active = 1";
$result = $db->query($sql);

$system = $db->fetch_assoc($result);

$sql = "SELECT * FROM wm_characters WHERE wm_characters.character_forum_id = '$forum_id' AND wm_characters.character_active = 1";
$result = $db->query($sql);

$character = $db->fetch_assoc($result);

if($system["system_config"]!="") {
  include_once($system["system_config"]);
}
else {
//load appropriate config - can be replaced when config.php is done
//include_once('config-default.php'); //for now, later we can grab the right one

}
?>
